package hrms.service;

import hrms.dao.PostMapper;
import hrms.entity.Post;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class PostService {
    @Autowired
    PostMapper postMapper;

    public  List<Post> selectAllPost(){
        return postMapper.selectAllPost();
    }

    public List<Post> selectPostByName(String pname){
        return postMapper.selectPostByName(pname);
    }

    public Integer updatePost(Post post){
        return postMapper.updatePost(post);
    }

    public Integer deletePost(Integer id){
        return postMapper.deletePostById(id);
    }

    public Integer addPost(Post post){
        return postMapper.addPost(post);
    }

    public List<Post> selectByDepartmentId(Integer departmentId){
        return postMapper.selectByDepartmentId(departmentId);
    }

    public Post selectDepartmentNameById(Integer id){
        return postMapper.selectDepartmentNmaeById(id);
    }
    
}
